clear all
use "EB.dta"
 

decode country, generate(country_string)
gen cntry = ""

replace cntry = "FR" if country_string == "France"
replace cntry = "BE" if country_string == "Belgium"
replace cntry = "NL" if country_string == "Netherlands"
replace cntry = "DE" if country_string == "Germany"
replace cntry = "IT" if country_string == "Italy"
replace cntry = "LU" if country_string == "Luxembourg"
replace cntry = "DK" if country_string == "Denmark"
replace cntry = "IE" if country_string == "Ireland"
replace cntry = "GB" if country_string == "Great Britain"
replace cntry = "ES" if country_string == "Spain"
replace cntry = "PT" if country_string == "Portugal"
replace cntry = "FI" if country_string == "Finland"
replace cntry = "SE" if country_string == "Sweden"
replace cntry = "AT" if country_string == "Austria"
replace cntry = "CZ" if country_string == "Czech Republic"
replace cntry = "EE" if country_string == "Estonia"
replace cntry = "HU" if country_string == "Hungary"
replace cntry = "LV" if country_string == "Latvia"
replace cntry = "LT" if country_string == "Lithuania"
replace cntry = "PL" if country_string == "Poland"
replace cntry = "SK" if country_string == "Slovakia"
replace cntry = "SI" if country_string == "Slovenia"
replace cntry = "TR" if country_string == "Turkey"
replace cntry = "HR" if country_string == "Croatia"
replace cntry = "AL" if country_string == "Albania"
replace cntry = "NO" if country_string == "Norway"
replace cntry = "CH" if country_string == "Switzerland"
drop if cntry==""
drop if cntry=="CH"

 g yrbrn= year-age
 
 keep if age>19
  
 
 keep if educ== 10
 
 drop if yrbrn<1973
drop if  yrbrn>1998
g short=0
replace short=1 if yrbrn>1978  & yrbrn<1994
 
 

*why UK control: https://www.hepi.ac.uk/wp-content/uploads/2014/02/36Bolognaprocessfull.pdf

 
g EU=1
replace EU=0 if cntry=="CH" | cntry=="NO" | cntry=="AL" 
replace EU=0 if (cntry=="HR" &  year<2013)
replace EU=0 if (cntry=="SI" &  year<2004)
replace EU=0 if (cntry=="CZ" &  year<2004)
replace EU=0 if (cntry=="HU" &  year<2004)
replace EU=0 if (cntry=="PL" &  year<2004)
replace EU=0 if (cntry=="GB" &  year>2016)
  
g West=0
replace West=1 if cntry=="AT" | cntry=="BE" | cntry=="CH" | cntry=="DE" | cntry=="FR"| cntry=="DK"| cntry=="NO"| cntry=="PT" | cntry=="ES" | cntry=="IT" | cntry=="LU" | cntry=="NL" | cntry=="FI" | cntry=="SE"
 
 g Bologna=0
 
 * Replace treatment for specific countries and cohorts
replace Bologna = 1 if cntry == "AL" & yrbrn >= 1986
replace Bologna = 1 if cntry == "AT" & yrbrn >= 1981
replace Bologna = 1 if cntry == "BE" & yrbrn >= 1986
replace Bologna = 1 if cntry == "HR" & yrbrn >= 1986
replace Bologna = 1 if cntry == "CZ" & yrbrn >= 1981
replace Bologna = 1 if cntry == "DK" & yrbrn >= 1981
replace Bologna = 1 if cntry == "EE" & yrbrn >= 1983
replace Bologna = 1 if cntry == "FI" & yrbrn >= 1985
replace Bologna = 1 if cntry == "FR" & yrbrn >= 1988
replace Bologna = 1 if cntry == "DE" & yrbrn >= 1983
replace Bologna = 1 if cntry == "HU" & yrbrn >= 1986
replace Bologna = 1 if cntry == "IT" & yrbrn >= 1982
replace Bologna = 1 if cntry == "LV" & yrbrn >= 1982
replace Bologna = 1 if cntry == "LT" & yrbrn >= 1981
replace Bologna = 1 if cntry == "LU" & yrbrn >= 1986
replace Bologna = 1 if cntry == "NL" & yrbrn >= 1984
replace Bologna = 1 if cntry == "PL" & yrbrn >= 1987
replace Bologna = 1 if cntry == "PT" & yrbrn >= 1987
replace Bologna = 1 if cntry == "SK" & yrbrn >= 1985
replace Bologna = 1 if cntry == "SI" & yrbrn >= 1985
replace Bologna = 1 if cntry == "ES" & yrbrn >= 1987
replace Bologna = 1 if cntry == "SE" & yrbrn >= 1988
replace Bologna = 1 if cntry == "NO" & yrbrn >= 1983
replace Bologna = 1 if cntry == "CH" & yrbrn >= 1985
drop if cntry=="CH"

 
 g running = . if Bologna == .

* Replace treatment for specific countries and cohorts
replace running = yrbrn - 1986 if cntry == "AL"
replace running = yrbrn - 1981 if cntry == "AT"
replace running = yrbrn - 1986 if cntry == "BE"
replace running = yrbrn - 1986 if cntry == "HR"
replace running = yrbrn - 1981 if cntry == "CZ"
replace running = yrbrn - 1981 if cntry == "DK"
replace running = yrbrn - 1983 if cntry == "EE"
replace running = yrbrn - 1985 if cntry == "FI"
replace running = yrbrn - 1988 if cntry == "FR"
replace running = yrbrn - 1983 if cntry == "DE"
replace running = yrbrn - 1986 if cntry == "HU"
replace running = yrbrn - 1982 if cntry == "IT"
replace running = yrbrn - 1982 if cntry == "LV"
replace running = yrbrn - 1981 if cntry == "LT"
replace running = yrbrn - 1986 if cntry == "LU"
replace running = yrbrn - 1984 if cntry == "NL"
replace running = yrbrn - 1987 if cntry == "PL"
replace running = yrbrn - 1987 if cntry == "PT"
replace running = yrbrn - 1985 if cntry == "SK"
replace running = yrbrn - 1985 if cntry == "SI"
replace running = yrbrn - 1987 if cntry == "ES"
replace running = yrbrn - 1988 if cntry == "SE"
replace running = yrbrn - 1983 if cntry == "NO"
replace running = yrbrn - 1986 if cntry == "CH"
replace running = 0 if cntry == "IL" | cntry == "GB"

 
g trend=running
 
  rename country Country 
  
 egen change=mean(Bologna), by(Country)
drop if change==0 & cntry!="GB"  

rename gender Female
la var Female "Female"
 
global controls_EB "Female  trend   i.year"

global FE_EB "i.Country i.yrbrn"

 
 keep if short==1
 
  reg party_att_deg Bologna $controls_EB $FE_EB, cluster(Country) 
 reg lr Bologna $controls_EB $FE_EB, cluster(Country)
 
 la var val_1 "Rule of law"
 la var val_2 "Respect for life"
 la var val_3 "Human rights"
 la var val_4 "Freedom"
 la var val_5 "Democracy"
 la var val_6 "Peace"
 la var val_7 "Equality"
 la var val_8 "Solidarity"
 la var val_9 "Tolerance"
 la var val_10 "Religion"
 la var val_11 "Self-fulfilment"
 la var val_12 "Respect for cultures"


* Step 1: Clear previous results
eststo clear

* Step 2: Run regressions and store results
reg val_1 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_1  
	estadd scalar ymean = r(mean)
eststo model1

reg val_2 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_2   
	estadd scalar ymean = r(mean)
eststo model2

reg val_3 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_3   
	estadd scalar ymean = r(mean)
eststo model3

reg val_4 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_4   
	estadd scalar ymean = r(mean)
eststo model4

reg val_5 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_5   
	estadd scalar ymean = r(mean)
eststo model5

reg val_6 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_6   
	estadd scalar ymean = r(mean)
eststo model6

 

noisily esttab model1 model2 model3 model4 model5 model6 using "T14.tex",  nolz  keep(Bologna  )  booktabs label  b(3) se(3) star(* 0.10 ** 0.05 *** 0.01)   stats(ymean r2   N, fmt(3 3  %9.0fc) labels(`"Output mean"' `"\textit{R}-sq"'   `"N. Obs"')) nonotes  noobs nonumbers  noeqlines coeflabels(Bologna "Reform")  ///
	 prehead("\begin{table}[h]\centering \footnotesize \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}   \caption{\scshape Additional: Values in Eurobarometer \label{EBvalues}}  \begin{center}   \begin{threeparttable} \begin{tabular}{l  cccccc} \toprule" )  ///
	 prefoot("[1.5ex] \cmidrule(lr{0.15em}){1-7}" ) ///
	 fragment ///
	 replace ///

reg val_7 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_7  
	estadd scalar ymean = r(mean)
eststo model7

reg val_8 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_8   
	estadd scalar ymean = r(mean)
eststo model8

reg val_9 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_9   
	estadd scalar ymean = r(mean)
eststo model9

reg val_10 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_10   
	estadd scalar ymean = r(mean)
eststo model10

reg val_11 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_11   
	estadd scalar ymean = r(mean)
eststo model11

reg val_12 Bologna $controls_EB $FE_EB, cluster(Country)
	quietly: sum val_12   
	estadd scalar ymean = r(mean)
eststo model12

	 noisily esttab   model7 model8 model9 model10 model11 model12 using "T14.tex", nolz  keep(Bologna   )  booktabs label  b(3) se(3)  star(* 0.10 ** 0.05 *** 0.01)   stats(ymean r2   N, fmt(3 3  %9.0fc) labels(`"Output mean"' `"\textit{R}-sq"'   `"N. Obs"')) nonotes  noobs nonumbers  noeqlines coeflabels(Bologna "Reform")  ///
	prehead("\midrule \\[-1ex]") ///
	posthead("\hline \\[-1ex]") ///
	prefoot("[1.5ex] \cmidrule(lr{0.15em}){1-7}") /// 
	postfoot("\toprule  \multicolumn{7}{l}{\hspace{1cm}  \small \scshape Common modelling assumptions}\\\\[-1ex] " ///
	"Country FE  &  yes  &  yes & yes &   yes   & yes &   yes  \\" ///
    "Year FE  & yes  &   yes &   yes &   yes & yes &   yes  \\  \toprule \end{tabular}  \begin{tablenotes} \setlength\labelsep{0pt}  \item \scriptsize {\textit{Notes.} Standard errors in parentheses. \sym{*} \(p<0.01\), \sym{**} \(p<0.05\), \sym{***} \(p<0.01\). Data are from the Harmonised 2004-217 Eurobarometer. We use the TWFE model and control for gender. The Eurobarometer does not include information about the year of birth. This is retrieved by subtracting age from year of the interview, which introduces measurement error. Furthermore, relative to the specification based on ESS data, we miss some control variables, including the level of education of the mother and whether the respondent is native or immigrant. The questions are all equally spelt. Each respondent is provided with a list of 12 values and can either mark them or not as 'important to them'. The country sample is the same as for the ESS, but does not include Israel as 'never treated'. Students are identified easily, as there is a question on whether the respondent is still studying which was asked in each round. The same sample restriction as for the analysis on students based on ESS data apply.}  \end{tablenotes}   \end{threeparttable}   \end{center}  \end{table}" ) ///
	fragment ///
	append  	
	
 
 
 


